package com.tuo51.childcare.domain.bize;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.tuo51.childcare.domain.vo.BizEvaluateQuestionOptionVO;
import com.tuo51.foudation.model.Domain;
import com.vladmihalcea.hibernate.type.json.JsonStringType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;

import javax.persistence.*;
import java.util.List;

/**
 * 选项的详情
 */

@Data
@Entity
@Table(name = "bize_question")
@EqualsAndHashCode(callSuper = true)
@TypeDef(name = "json", typeClass = JsonStringType.class)
public class BizEvaluateQuestion extends Domain{

    @Column(columnDefinition = "int default 0 COMMENT '月龄'")
    private Integer month = 0;

    @Column(columnDefinition = "int default '0' COMMENT '纸上序号'")
    private Integer indexOnPaper;

    @Column(columnDefinition = "int default '0' COMMENT '不通过短路序号'")
    private Integer shortIndex;

    @Column(columnDefinition = " bit DEFAULT 0 COMMENT '充分操作。 0：否，1是' ")
    private Boolean asPossibleAs = false;

    @Column(columnDefinition = " varchar(50) COMMENT '充分操作提示。' ")
    private String asPossibleAsTips;

    @Column(columnDefinition = " bit DEFAULT 0 COMMENT '是否询问家长。 0：否，1是' ")
    private Boolean parentAnswer = false;

    @Column(columnDefinition = "varchar(50) COMMENT '测评题目' ")
    private String title;

    @Column(columnDefinition = "varchar(500) COMMENT '问题详情，操作方法，步骤' ")
    private String detail;

    @Column(columnDefinition = "varchar(255) COMMENT '指导视频' ")
    private String guideVideo;

    @Column(columnDefinition = "varchar(255) COMMENT '指导视频封面' ")
    private String guideVideoCover;

    @Column(columnDefinition = "varchar(500) COMMENT '操作方法' ")
    private String operationGuide;

    @Column(columnDefinition = "varchar(500) COMMENT '通过标准' ")
    private String passingCriteria;

    @Type(type = "json")
    @Column(columnDefinition = "JSON COMMENT '选项：名称，分值，对应分值跳过的题目' ")
    private List<BizEvaluateQuestionOptionVO> options;

    @Column(columnDefinition = " int DEFAULT 1 COMMENT '答案类型, 1.单选， 2.多选，  3.文本， 4.判断' ")
    private Integer answerType;

    @Column(columnDefinition = " int DEFAULT 1 COMMENT '多选单选数量' ")
    private Integer multipleCount;

    @Column(columnDefinition = "DOUBLE COMMENT '得分系数' ")
    private Double factor = 1D;

    @ManyToOne
    @JoinColumn(name = "itemId", columnDefinition = "varchar(32) default '' COMMENT '测评单元的id'")
    @JsonIgnore
    private BizEvaluateItem item;

    //维度评分
    @Column(name = "toolId",columnDefinition = " varchar(32) default '' COMMENT '工具id'")
    @JsonIgnore
    private String toolId;

    @Column(name = "sheetId",columnDefinition = " varchar(32) default '' COMMENT '量表id'")
    @JsonIgnore
    private String sheetId;

    @Column(name = "dimensionId",columnDefinition = " varchar(32) default '' COMMENT '维度id'")
    @JsonIgnore
    private String dimensionId;



}
